package com.yuntai.pms.model.enums;

import java.util.HashMap;
import java.util.Map;

public enum DeptStateEnum {

    FREEZN(0, "冻结"),
    ENABLED(1, "启用"),
    REVOKE(2, "停用"),
    DELETE(-1, "删除");

    private Integer code;
    private String name;

    private static Map<Integer, String> stateMap = new HashMap<>();

    private DeptStateEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    static {
        stateMap.put(FREEZN.getCode(), FREEZN.getName());
        stateMap.put(ENABLED.getCode(), ENABLED.getName());
        stateMap.put(REVOKE.getCode(), REVOKE.getName());
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static Map<Integer, String> getStateMap() {
        return stateMap;
    }
}
